package regex;

import static net.ftng.commons.lang.utils.PrintUtils.println;

public class UrlPath {

    public static void main(final String[] args) {

        String pattern = "[http://|https://][^/]*/";
        String url = "http://www.ftng.net/hello.html";
        String[] split = url.split(pattern);
        println(split);

        println("=============");
        url = "https://www.ftng.net/hello.html";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "http://www.ftng.net/admin/hello.html";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "https://www.ftng.net/admin/hello.html";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "http://www.ftng.net/admin/hello.html?collection=1";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "https://www.ftng.net/admin/hello.html?collection=1";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "admin/hello.html?collection=1";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "admin/hello.html?collection=1";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "/admin/hello.html?collection=1";
        split = url.split(pattern);
        println(split);

        println("=============");
        url = "/admin/hello.html?collection=1";
        split = url.split(pattern);
        println(split);
    }
}
